Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@cbracken
Copy link
Member

@cbracken cbracken commented Jun 7, 2023

Previously, when creating native platform views on macOS, we ignored any parameters passed via the framework side "params" argument in the "create" method call, and instead always passed a nil value to the FlutterPlatformViewFactory. This made it impossible for users of macOS platform views to pass constructor arguments to the NSView subclass implementing the platform view.

We now decode the arguments data using the codec specified by the FlutterPlatformViewFactory and pass them through to the [FlutterPlatformViewFactory createWithIdentifier:arguments:] method where the platform view author can make use of them.

Fixes: flutter/flutter#124723

This is a part of the broader macOS platform view support effort: flutter/flutter#41722

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@cbracken cbracken changed the title [macOS] Add platformview create parameter support [macOS] Add platformview creation parameter support Jun 7, 2023
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

cbracken added 2 commits June 7, 2023 09:55
Previously, when creating native platform views on macOS, we ignored any
parameters passed via the framework side "params" argument in the
"create" method call, and instead always passed a nil value to the
FlutterPlatformViewFactory. This made it impossible for users of macOS
platform views to pass constructor arguments to the NSView subclass
implementing the platform view.

We now decode the arguments data using the codec specified by the
`FlutterPlatformViewFactory` and pass them through to the
`[FlutterPlatformViewFactory createWithIdentifier:arguments:]` method
where the platform view author can make use of them.

Fixes: flutter/flutter#124723

This is a part of the broader macOS platform view support effort:
flutter/flutter#41722
@cbracken cbracken added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 7, 2023
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@auto-submit
Copy link
Contributor

auto-submit bot commented Jun 7, 2023

auto label is removed for flutter/engine, pr: 42607, due to - The status or check suite Windows windows_host_engine has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 7, 2023
@cbracken cbracken added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 7, 2023
@auto-submit auto-submit bot merged commit 71c9d51 into flutter:main Jun 7, 2023
@cbracken cbracken deleted the ctor-params branch June 7, 2023 19:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass platform view arguments on macOS

3 participants